public class ConstructorAndMethodScope {

	// private ConstructorAndMethodScope(long[] d) {
	// System.out.println("hello aaa");
	// }

	private ConstructorAndMethodScope() {
		System.out.println("empty arg constructor");
	}

	private ConstructorAndMethodScope(Object o) {
		System.out.println("hello world.");
	}

	private ConstructorAndMethodScope(String str) {
		System.out.println("hellow str");
	}

	// private ConstructorAndMethodScope(String[] c) {
	// System.out.println("hello java!");
	// }

	private void privateMethod() {
		System.out.println("I am a private method");
	}

	/**
	 * 在对象的main方法里可以调用 对象的私有构造器,私有方法
	 * 而在别的对象里边不行,即使两对象在同一文件中
	 * 
	 * 函数的多态:参数会以最匹配的那个参数去匹配函数 
	 * null会把Object当作最后一个选择去匹配
	 */
	public static void main(String[] args) {

		new ConstructorAndMethodScope(null).privateMethod();//null 参数匹配

		String str = null;
		new ConstructorAndMethodScope(str);

	}
}


class AnotherClass {

	void invock2() {
//		 new ConstructorAndMethodScope(null).privateMethod();//error not visible
	}
}